<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>01-生命周期钩子函数</title>
  </head>
  <body>
    <div id="app">
      <h1>vue的例子</h1>
      <hello :msg="msg1"></hello>
      <myhello></myhello>
    </div>
    <script src="./js/vue.js"></script>
    <script>
      Vue.config.productionTip = false // 关闭生产提示
      Vue.component('hello', {
        template: `
            <div>
                <h3>template标题{{msg}}</h3>
            </div>
        `,
        data() {
          return {
            say: '你好',
          }
        },
        props: ['msg'],
      })
      const vm = new Vue({
        el: '#app',
        // template:"<button>template标签</button>",
        data: {
          msg1: 'hello，哈哈哈哈',
        },
        components: {
          myhello: {
            template: `
            <div>
                <h3>这是局部组件</h3>
            </div>
            `,
          },
        },

      })
      //   vm.$mount("#app")
    </script>
  </body>
</html>
